package app.model;

import org.hibernate.Session;

public class StorageResult<T> 
{
	
	Session session;
	Iterable<T> result;
	
	
	public StorageResult( Session session , Iterable<T> result )
	{
		this.session = session;
		this.result = result;
	}
	
	public Iterable<T> getResult()
	{
		return this.result;
	}
	
	@Override
	protected void finalize() throws Throwable {
		
		if ( session != null )
			session.close();
		
		super.finalize();
	}
	
}
